package ControllerGraph

import (
	"github.com/gin-gonic/gin"
	"log"
	"ustcLab/server/service/ServiceGraph"
)

func HandlerGraph(ctx *gin.Context) {
	ctx.String(200, "test message.")
}

func HandlerItemPost(ctx *gin.Context) {
	ctx.String(200, "test message.")
}

func HandlerItemDelete(ctx *gin.Context) {
	ctx.String(200, "test message.")
}
func HandlerItemGet(ctx *gin.Context) {
	q := ctx.Query("q")

	substance, link := ServiceGraph.SplitWord(q)
	objArr, err := ServiceGraph.FindObject(substance, link)
	if err != nil {
		log.Println("[HandlerItemGet] find object failed.")
	}
	ctx.JSON(200, objArr)
}